home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / mgmtapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  5.3 KB  |  152 lines

  1. /*++
  2.  
  3. Copyright (c) 1992-1996 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     mgmtapi.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions for SNMP Management API Development.
  12.  
  13. --*/
  14.  
  15. /*
  16.  *      C/C++ Run Time Library - Version 9.0
  17.  *
  18.  *      Copyright (c) 1997, 1998 by Borland International
  19.  *      All Rights Reserved.
  20.  *
  21.  */
  22.  
  23. #ifndef _INC_MGMTAPI
  24. #define _INC_MGMTAPI
  25. #pragma option push -b
  26.  
  27.  
  28. ///////////////////////////////////////////////////////////////////////////////
  29. //                                                                           //
  30. // Additional header files                                                   //
  31. //                                                                           //
  32. ///////////////////////////////////////////////////////////////////////////////
  33.  
  34.  
  35. #include <snmp.h>
  36.  
  37.  
  38. #include <winsock.h>
  39.  
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. ///////////////////////////////////////////////////////////////////////////////
  46. //                                                                           //
  47. // MGMT API error code definitions                                           //
  48. //                                                                           //
  49. ///////////////////////////////////////////////////////////////////////////////
  50.  
  51. #define SNMP_MGMTAPI_TIMEOUT                40
  52. #define SNMP_MGMTAPI_SELECT_FDERRORS        41
  53. #define SNMP_MGMTAPI_TRAP_ERRORS            42
  54. #define SNMP_MGMTAPI_TRAP_DUPINIT           43
  55. #define SNMP_MGMTAPI_NOTRAPS                44
  56. #define SNMP_MGMTAPI_AGAIN                  45
  57.  
  58. ///////////////////////////////////////////////////////////////////////////////
  59. //                                                                           //
  60. // MGMT API miscellaneous definitions                                        //
  61. //                                                                           //
  62. ///////////////////////////////////////////////////////////////////////////////
  63.  
  64. #define RECVBUFSIZE                         4096
  65.  
  66. ///////////////////////////////////////////////////////////////////////////////
  67. //                                                                           //
  68. // MGMT API type definitions                                                 //
  69. //                                                                           //
  70. ///////////////////////////////////////////////////////////////////////////////
  71.  
  72. typedef SOCKET SockDesc;
  73.  
  74. typedef struct _SNMP_MGR_SESSION {
  75.     SockDesc        fd;                     // socket
  76.     struct sockaddr destAddr;               // destination agent address
  77.     LPSTR           community;              // community name
  78.     INT             timeout;                // comm time-out (milliseconds)
  79.     INT             retries;                // comm retry count
  80.     AsnInteger      requestId;              // RFC1157 requestId
  81.     char            recvBuf[RECVBUFSIZE];   // receive buffer
  82. } SNMP_MGR_SESSION, *LPSNMP_MGR_SESSION;
  83.  
  84. ///////////////////////////////////////////////////////////////////////////////
  85. //                                                                           //
  86. // MGMT API prototypes                                                       //
  87. //                                                                           //
  88. ///////////////////////////////////////////////////////////////////////////////
  89.  
  90. LPSNMP_MGR_SESSION
  91. SNMP_FUNC_TYPE
  92. SnmpMgrOpen(
  93.     IN LPSTR lpAgentAddress,                // Name/address of target agent
  94.     IN LPSTR lpAgentCommunity,              // Community for target agent
  95.     IN INT   nTimeOut,                      // Comm time-out in milliseconds
  96.     IN INT   nRetries                       // Comm time-out/retry count
  97.     );
  98.  
  99. BOOL
  100. SNMP_FUNC_TYPE
  101. SnmpMgrClose(
  102.     IN LPSNMP_MGR_SESSION session           // SNMP session pointer
  103.     );
  104.  
  105. SNMPAPI
  106. SNMP_FUNC_TYPE
  107. SnmpMgrRequest(
  108.     IN     LPSNMP_MGR_SESSION session,           // SNMP session pointer
  109.     IN     BYTE               requestType,       // Get, GetNext, or Set
  110.     IN OUT RFC1157VarBindList *variableBindings, // Varible bindings
  111.        OUT AsnInteger         *errorStatus,      // Result error status
  112.        OUT AsnInteger         *errorIndex        // Result error index
  113.     );
  114.  
  115. BOOL
  116. SNMP_FUNC_TYPE
  117. SnmpMgrStrToOid(
  118.     IN  LPSTR               string,         // OID string to be converted
  119.     OUT AsnObjectIdentifier *oid            // OID internal representation
  120.     );
  121.  
  122. BOOL
  123. SNMP_FUNC_TYPE
  124. SnmpMgrOidToStr(
  125.     IN  AsnObjectIdentifier *oid,           // OID to be converted
  126.     OUT LPSTR               *string         // OID string representation
  127.     );
  128.  
  129. BOOL
  130. SNMP_FUNC_TYPE
  131. SnmpMgrTrapListen(
  132.     OUT HANDLE *phTrapAvailable             // Event indicating trap available
  133.     );
  134.  
  135. BOOL
  136. SNMP_FUNC_TYPE
  137. SnmpMgrGetTrap(
  138.     OUT AsnObjectIdentifier *enterprise,         // Generating enterprise
  139.     OUT AsnNetworkAddress   *IPAddress,          // Generating IP address
  140.     OUT AsnInteger          *genericTrap,        // Generic trap type
  141.     OUT AsnInteger          *specificTrap,       // Enterprise specific type
  142.     OUT AsnTimeticks        *timeStamp,          // Time stamp
  143.     OUT RFC1157VarBindList  *variableBindings    // Variable bindings
  144.     );
  145.  
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149.  
  150. #pragma option pop
  151. #endif // _INC_MGMTAPI
  152.